package cn.edu.zjut.service.impl;

import cn.edu.zjut.entity.ImageEntity;
import cn.edu.zjut.repository.ImageRepository;
import cn.edu.zjut.service.IImageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @description:
 * @author:ZhouDan
 * @date: 2020/8/10
 * @version: 1.0
 */
@Service
public class ImageServiceImpl implements IImageService {
    @Autowired
    private ImageRepository imageRepository;
    @Override
    public ImageEntity getById(Long id) {
        return imageRepository.findById(id);
    }

    @Override
    public ImageEntity getByName(String name) {
        return imageRepository.findByName(name);
    }

    @Override
    public ImageEntity getByUserId(long id) {
        return imageRepository.findByUserId(id);
    }

    @Override
    public ImageEntity save(ImageEntity imageEntity) {
        return imageRepository.save(imageEntity);
    }
}
